HomeAbout MeContact

PowerApps Test Automation

Published in Power Platform
March 14, 2021
2 min read
PowerApps Test Automation

The demo shows how to utilize the Test automation feature of PowerApps to make sure that our Apps are working as expected.

First, let’s create a Blank Canvas App.

Creating a List named "Test Site List Only"
Creating a List named "Test Site List Only"

Then name our App “Test Automate.”

Creating a List named "Test Site List Only"
Creating a List named "Test Site List Only"

Once the App is built, we will insert two Text Input and two labels on our Canvas.

Creating a List named "Test Site List Only"
Creating a List named "Test Site List Only"

For each Text Input, let’s remove the default value.

Creating a List named "Test Site List Only"
Creating a List named "Test Site List Only"

We will add another “Label” at the bottom, and we will call it “LabelSum,” let’s also get the sum of both TextInput1 and TextInput2, and we are going to display it on text( we also make the font bigger as well)

Creating a List named "Test Site List Only"
Creating a List named "Test Site List Only"

Save our change, open the Test Studio by clicking on Advanced Tools, then click on “Open tests.”

Creating a List named "Test Site List Only"
Creating a List named "Test Site List Only"

It will now open the “Test Studio” in a new tab.

Creating a List named "Test Site List Only"
Creating a List named "Test Site List Only"

Let now record and try writing Test Cases by clicking on the Record button.

Creating a List named "Test Site List Only"
Creating a List named "Test Site List Only"

Try adding a value in “TextInput1” and also “Textinput2”, you will notice that it records on the left that each step that we did. Click on “Done”

Creating a List named "Test Site List Only"
Creating a List named "Test Site List Only"

You will redirect to the “Test Studio” with the Test Case filled up through our record.

Creating a List named "Test Site List Only"
Creating a List named "Test Site List Only"

We will now add a new step called “Assert,” which checks and validates if a given condition returns true. We can do that by clicking on the last step of our test case, then clicking on “Insert step below,” then selecting “Assert.”

Creating a List named "Test Site List Only"
Creating a List named "Test Site List Only"

It should add a new step for Assert.

Creating a List named "Test Site List Only"
Creating a List named "Test Site List Only"

Assert can accept two arguments. The First Arguments is the condition that we wanted to check, and the Second Argument agrees with a string that will be displayed if the first Argument is not true

Creating a List named "Test Site List Only"
Creating a List named "Test Site List Only"

We will now Publish our changes and click on the “Play” button.

Creating a List named "Test Site List Only"
Creating a List named "Test Site List Only"

Since the condition we set in our set returns true, our error message didn’t show up. Now let us change the value and make sure the Assert will encounter an error.

Creating a List named "Test Site List Only"
Creating a List named "Test Site List Only"

Now Assert encountered an error because we are trying to find the text “3” to our LabelSum

Creating a List named "Test Site List Only"
Creating a List named "Test Site List Only"

Testing is a pretty nifty feature to ensure that the App we built is working perfectly through testing. Note that this feature is still on the “Experimental” stage, so I don’t suggest using it on your production projects.


Tags

O365M365SharePoint OnlinePowerAppsTest Automation

Share


Previous Article
SPFx Tutorial for basic CRUD Operation based on ReactJS

Related Posts

Taming the Managed Solution Beast - How to Update Environment Variables
Taming the Managed Solution Beast - How to Update Environment Variables
May 10, 2024
1 min

Quick Links

About MeContact Me

Social Media